package com.tms.order.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.tms.order.domain.Driveryj;
import com.tms.order.service.IDriveryjService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;

/**
 * 司机业绩统计Controller
 *
 * @author ruoyi
 * @date 2024-10-25
 */
@RestController
@RequestMapping("/driveryj")
public class DriveryjController extends BaseController
{
    @Autowired
    private IDriveryjService driveryjService;

    /**
     * 查询司机业绩统计列表
     */
    @RequiresPermissions("driveryj:driveryj:list")
    @GetMapping("/list")
    public TableDataInfo list(Driveryj driveryj)
    {
        startPage();
        List<Driveryj> list = driveryjService.selectDriveryjList(driveryj);
        return getDataTable(list);
    }

    /**
     * 导出司机业绩统计列表
     */
    @RequiresPermissions("driveryj:driveryj:export")
    @PostMapping("/export")
    public void export(HttpServletResponse response, Driveryj driveryj)
    {
        List<Driveryj> list = driveryjService.selectDriveryjList(driveryj);
        ExcelUtil<Driveryj> util = new ExcelUtil<Driveryj>(Driveryj.class);
        util.exportExcel(response, list, "司机业绩统计数据");
    }

    /**
     * 获取司机业绩统计详细信息
     */
    @RequiresPermissions("driveryj:driveryj:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(driveryjService.selectDriveryjById(id));
    }

    /**
     * 新增司机业绩统计
     */
    @RequiresPermissions("driveryj:driveryj:add")
    @PostMapping
    public AjaxResult add(@RequestBody Driveryj driveryj)
    {
        return toAjax(driveryjService.insertDriveryj(driveryj));
    }

    /**
     * 修改司机业绩统计
     */
    @RequiresPermissions("driveryj:driveryj:edit")
    @PutMapping
    public AjaxResult edit(@RequestBody Driveryj driveryj)
    {
        return toAjax(driveryjService.updateDriveryj(driveryj));
    }

    /**
     * 删除司机业绩统计
     */
    @RequiresPermissions("driveryj:driveryj:remove")
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(driveryjService.deleteDriveryjByIds(ids));
    }



}
